import os
from utils import SessionManager, load_json_to_dict

base_path = os.path.dirname(os.path.abspath(__file__))


def get_role(role):
    '''
    获取用户身份
    '''
    return load_json_to_dict(base_path + '/user.json')[role]


class RequestHanlder(SessionManager):
    '''
    喀斯玛请求类-继承自 utils.SessionManager
    Args:
        role (str): 用户身份(`Buyer` or `Seller`)
    '''

    def __init__(self, role):
        super().__init__()
        self._session = None